package com.mengze.linlee_iot_adnroid.activity

import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MotionEvent
import android.view.inputmethod.InputMethodManager
import com.mengze.linlee_iot_adnroid.R
import com.mengze.linlee_iot_adnroid.databinding.ActivityWifiConnectionBinding

class WifiConnectionActivity : AppCompatActivity() {

    private  lateinit var binding: ActivityWifiConnectionBinding;

    private fun updateStatusBarAndNavBar(){
        binding = ActivityWifiConnectionBinding.inflate(layoutInflater)
        setContentView(binding.root)
        binding.toolbarTitle.text = "wifi配网"
        window.statusBarColor = Color.parseColor("#FF54D437") // 橙色
        window.apply {
            var statusBarColor = Color.parseColor("#FF54D437") // 设置颜色
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_wifi_connection)
        updateStatusBarAndNavBar()


    }

    override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
        currentFocus?.let {
            val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
            imm.hideSoftInputFromWindow(it.windowToken, 0)
            it.clearFocus()
        }
        return super.dispatchTouchEvent(ev)
    }

}


